/**
 * @Author: 焦质晔
 * @Date: 2019/6/20
 * @Last Modified by:   焦质晔
 * @Last Modified time: 2019-06-20 15:45:00
 */
import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 获取主页面列表数据
export const getList = params =>
  axios.get(`${SERVER.MEMBERS_CLUB}/management/voucherGrant/search`, {
    params
  });

// 获取选择车辆页面车辆列表数据
export const getVinList = params =>
  axios.get(`${SERVER.MEMBERS_CLUB}/management/voucherGrant/searchVin`, {
    params
  });

// 处理代金券发放
export const excuteVoucherGrant = params => axios.post(`${SERVER.MEMBERS_CLUB}/management/voucherGrant/saveOrUpdate`, params);

// 根据Vin查询代金券发放记录
export const searchVoucherByVin = params =>
  axios.get(`${SERVER.MEMBERS_CLUB}/management/voucherGrant/searchVoucherByVin`, {
    params
  });

// 删除记录
export const doRemove = params =>
  axios.get(`${SERVER.MEMBERS_CLUB}/management/voucherGrant/deleteById`, {
    params
  });

// 删除记录
export const deleteByVCardNo = params =>
  axios.get(`${SERVER.MEMBERS_CLUB}/management/voucherGrant/deleteByVCardNo`, {
    params
  });

export const loadVoucher1 = params => axios.get(`${SERVER.MEMBERS_CLUB}/basic/category/downloadCouponOutTheDetails`, { params });

// 代金券发放-查询车档的客户信息
export const getcusInfo = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/memberInfo/getCusInfoForVoucher`, { params });
